package Panels;

import javax.swing.JPanel;
import javax.swing.ImageIcon;

import IViews.IAlert;
import IViews.IBackButton;
import IViews.IBackground;
import IViews.ICheckbox;
import IViews.ILoading;
import IViews.INormalButton;
import IViews.ITableView;
import IViews.IToolbar;
import Lib.TestThread;

import javax.swing.JButton;
import javax.swing.JLabel;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JTextField;
import javax.swing.SwingConstants;

public class Login extends DefaultPanel {

	private Login myRef;

	public Login(final MainInterface pMain) {
		super(pMain);
		myRef = this;

		final ITableView it = new ITableView(340, 200, 600);
		it.newEntryString("username", "Name", "Nils");
		it.newEntryPassword("userpassword", "Passwort", "");
		add(it);
		INormalButton btn = new INormalButton("Login", 540, 350, 200, 0);
		btn.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				// TODO Auto-generated method stub
				super.mouseClicked(e);
				
				  System.out.println("Teste Login: "+it.entryOfString("username"
				  )+"\t"+it.entryOfString("userpassword"));
				  mainView.openTourPlan();
				 
				/*a(new ILoading(myRef, null));
				TestThread t = new TestThread();
				t.start();*/
			}
		});
		add(btn);
		add(new IBackground(0, 0, WindowsConsts.WIDTH, WindowsConsts.HEIGHT, 0));
		
		//a(new IAlert(400, 300, "Test", "Mein Text... Hallo Welt.", this));

	}
}
